<template lang="html">
  <div id="app">
    <v-header :seller="seller"></v-header>
    <div class="tab border-bottom-1px">
      <div class="tab-item">
        <router-link to="/goods">商品</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/ratings">评价</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/sellers">商家</router-link>
      </div>
    </div>
    <div id="content">
      <router-view></router-view>
    </div>

  </div>
</template>

<script>
  import header from '@/components/header/header'

  const ERR_OR = 0 // 成功
  // const ERR_FAIL = 0 // 失败

  export default {
    data () {
      return {
        seller: {}
      }
    },
    created () {
      this.$http.get('/api/sellers')
        .then((response) => {
          response = response.body
          if (response.errno === ERR_OR) {
            this.seller = response.data
          }
        })
    },
    components: {
      'v-header': header
    }
  }
</script>

<style lang="scss" rel="stylesheet/scss">
  @import './App';
</style>
